﻿using CrmCustomizationsExcelAddIn.Data;
using CrmCustomizationsExcelAddIn.Helper;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CrmCustomizationsExcelAddIn
{
    public partial class CrmViewDetails : Form
    {
        public CrmViewDetails()
        {
            InitializeComponent();
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtViewName.Text))
            {
                MessageBox.Show("View must have a Name");
                return;
            }
            GlobalOperations.CreatenNewViewSheet(txtViewName.Text, txtViewDescription.Text, GlobalApplicationData.Instance.selectedEntityTree);
            this.Close();
        }

        private void CrmViewDetails_Load(object sender, EventArgs e)
        {

        }
    }
}
